package com.xqboss.apps.service.order.type.impl;

import com.xqboss.apps.domain.order.OrderMain;
import com.xqboss.apps.dto.order.CreateOrderDto;
import com.xqboss.apps.enums.order.OrderTypeEnum;
import com.xqboss.apps.service.nft.NftService;
import com.xqboss.apps.service.order.type.OrderTypeExecutor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *     空投订单执行器
 * </p>
 * @author Trent
 * @date 2023/8/23
 */
@Component(value = OrderTypeEnum.Code.Airdrop)
public class AirdropOrderTypeExecutor extends OrderTypeExecutor {

    @Autowired
    private NftService nftService;

    @Override
    protected OrderMain preValidate(CreateOrderDto params) {
        // 获取NFT信息
        return buildOrder(params);
    }

    @Override
    protected void lockStock(Long sourceId, Integer quantity) {
        // 扣除NFT藏品库存
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void orderPayedPost(OrderMain order) {

    }
}
